Optimal. Leaf size=86 \[ -\frac{\left (-2 a c d+b^2 d-b c e\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^2 \sqrt{b^2-4 a c}}-\frac{(b d-c e) \log \left (a+b x+c x^2\right )}{2 c^2}+\frac{d x}{c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0812762, antiderivative size = 86, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.273, Rules used = {1393, 773, 634, 618, 206, 628} \[ -\frac{\left (-2 a c d+b^2 d-b c e\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^2 \sqrt{b^2-4 a c}}-\frac{(b d-c e) \log \left (a+b x+c x^2\right )}{2 c^2}+\frac{d x}{c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1393
Rule 773
Rule 634
Rule 618
Rule 206
Rule 628
Rubi steps
\begin{align*} \int \frac{d+\frac{e}{x}}{c+\frac{a}{x^2}+\frac{b}{x}} \, dx &=\int \frac{x (e+d x)}{a+b x+c x^2} \, dx\\ &=\frac{d x}{c}+\frac{\int \frac{-a d+(-b d+c e) x}{a+b x+c x^2} \, dx}{c}\\ &=\frac{d x}{c}-\frac{(b d-c e) \int \frac{b+2 c x}{a+b x+c x^2} \, dx}{2 c^2}+\frac{\left (b^2 d-2 a c d-b c e\right ) \int \frac{1}{a+b x+c x^2} \, dx}{2 c^2}\\ &=\frac{d x}{c}-\frac{(b d-c e) \log \left (a+b x+c x^2\right )}{2 c^2}-\frac{\left (b^2 d-2 a c d-b c e\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c^2}\\ &=\frac{d x}{c}-\frac{\left (b^2 d-2 a c d-b c e\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^2 \sqrt{b^2-4 a c}}-\frac{(b d-c e) \log \left (a+b x+c x^2\right )}{2 c^2}\\ \end{align*}
Mathematica [A] time = 0.0898583, size = 86, normalized size = 1. \[ \frac{\frac{2 \left (-2 a c d+b^2 d-b c e\right ) \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right )}{\sqrt{4 a c-b^2}}+(c e-b d) \log (a+x (b+c x))+2 c d x}{2 c^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.003, size = 161, normalized size = 1.9 \begin{align*}{\frac{dx}{c}}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ) bd}{2\,{c}^{2}}}+{\frac{\ln \left ( c{x}^{2}+bx+a \right ) e}{2\,c}}-2\,{\frac{ad}{c\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+{\frac{{b}^{2}d}{{c}^{2}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}-{\frac{be}{c}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.29934, size = 643, normalized size = 7.48 \begin{align*} \left [\frac{2 \,{\left (b^{2} c - 4 \, a c^{2}\right )} d x +{\left (b c e -{\left (b^{2} - 2 \, a c\right )} d\right )} \sqrt{b^{2} - 4 \, a c} \log \left (\frac{2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c + \sqrt{b^{2} - 4 \, a c}{\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) -{\left ({\left (b^{3} - 4 \, a b c\right )} d -{\left (b^{2} c - 4 \, a c^{2}\right )} e\right )} \log \left (c x^{2} + b x + a\right )}{2 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )}}, \frac{2 \,{\left (b^{2} c - 4 \, a c^{2}\right )} d x + 2 \,{\left (b c e -{\left (b^{2} - 2 \, a c\right )} d\right )} \sqrt{-b^{2} + 4 \, a c} \arctan \left (-\frac{\sqrt{-b^{2} + 4 \, a c}{\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) -{\left ({\left (b^{3} - 4 \, a b c\right )} d -{\left (b^{2} c - 4 \, a c^{2}\right )} e\right )} \log \left (c x^{2} + b x + a\right )}{2 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 1.26763, size = 423, normalized size = 4.92 \begin{align*} \left (- \frac{\sqrt{- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac{b d - c e}{2 c^{2}}\right ) \log{\left (x + \frac{- a b d - 4 a c^{2} \left (- \frac{\sqrt{- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac{b d - c e}{2 c^{2}}\right ) + 2 a c e + b^{2} c \left (- \frac{\sqrt{- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac{b d - c e}{2 c^{2}}\right )}{2 a c d - b^{2} d + b c e} \right )} + \left (\frac{\sqrt{- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac{b d - c e}{2 c^{2}}\right ) \log{\left (x + \frac{- a b d - 4 a c^{2} \left (\frac{\sqrt{- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac{b d - c e}{2 c^{2}}\right ) + 2 a c e + b^{2} c \left (\frac{\sqrt{- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac{b d - c e}{2 c^{2}}\right )}{2 a c d - b^{2} d + b c e} \right )} + \frac{d x}{c} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.10065, size = 115, normalized size = 1.34 \begin{align*} \frac{d x}{c} - \frac{{\left (b d - c e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c^{2}} + \frac{{\left (b^{2} d - 2 \, a c d - b c e\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{\sqrt{-b^{2} + 4 \, a c} c^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]